import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import axios from 'axios'
import 'element-ui/lib/theme-chalk/index.css';
import ElementUI from 'element-ui';
import Login from "@/views/Login";
import News from "@/views/News";
import Register from "@/views/Register";
import Dnews from "@/views/news/Dnews";
import Snews from "@/views/news/Snews";
import Welcome from "@/views/news/Welcome";

Vue.use(VueRouter)
Vue.use(ElementUI)
Vue.prototype.$ajax=axios


Vue.config.productionTip = false

new Vue({
    router:new VueRouter({
        routes:[
            {
                path:"/",
                component:Login
            },
            {
                path: "/register",
                component: Register
            },
            {
                path: "/news",
                component: News,
                children:[{
                    path:"dnews",
                    component:Dnews
                },
                    {
                        path:"snews",
                        component:Snews
                    },
                    {
                        path:"",
                        component:Welcome
                    }]
            }
        ]
        }
    ),
  render: h => h(App),
}).$mount('#app')
